#include <linux/clockchips.h>
#include <linux/percpu.h>

#include "../inc/tick.h"
#include "../inc/timekeeping.h"

static void tick_periodic(int cpu)
{
    if (cpu == 0)
    {
        jiffies_increase(1);
    }

    update_process_times(0);
}

void tick_handle_periodic(struct clock_event_device *dev)
{
    int cpu = smp_processor_id();

    tick_periodic(cpu);
}

/*
 * Setup the device for a periodic tick
 */
void tick_setup_periodic(struct clock_event_device *dev, int broadcast)
{
    dev->event_handler = tick_handle_periodic;
}
